package top.hkyzf.study.leetcode.weekly;

import org.junit.Test;

/**
 * description: 
 * @author zhufeng
 * @date 2024/2/4 0004 10:34
 * @version V1.0
 */
public class 边界上的蚂蚁_100214 {
    public int returnToBoundaryCount(int[] nums) {
        int temp = 0;
        int result = 0;
        for (int num : nums) {
            temp += num;
            if (temp == 0) {
                result++;
            }
        }
        return result;
    }

    @Test
    public void testReturn () {
        int[] nums = {3,2,-5,-4,4};
        System.out.println(returnToBoundaryCount(nums));
    }
}
